﻿<%@ Page Title="Coca-Cola 添加销售点" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true"
    CodeBehind="ModifyScoreEntry.aspx.cs" Inherits="PCMSofCC.Admin.ScoreEntryManagement" %>

<asp:Content ID="Content2" ContentPlaceHolderID="Head" runat="server">
    <link href="../css/content.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="Main" runat="server">
    <div id="container" class="container">
        <div id="content" class="content">
            <div id="scoreEntryContainer" class="scoreEntryContainer">
                <asp:GridView ID="GridView1" runat="server" RowStyle-CssClass="gridViewItem1" CssClass="gridView"
                    AlternatingRowStyle-CssClass="gridViewItem2" AutoGenerateColumns="False" 
                    DataSourceID="SqlDataSource1" DataKeyNames="Id">
                    <RowStyle CssClass="gridViewItem1"></RowStyle>
                    <Columns>
                        <asp:BoundField HeaderStyle-CssClass="gridViewHead" DataField="Name" HeaderText="评分项"
                            SortExpression="Name">
                            <HeaderStyle CssClass="gridViewHead"></HeaderStyle>
                        </asp:BoundField>
                        <asp:BoundField HeaderStyle-CssClass="gridViewHead" DataField="MaxScore" HeaderText="考核分数"
                            SortExpression="MaxScore">
                            <HeaderStyle CssClass="gridViewHead"></HeaderStyle>
                        <ItemStyle Width="50px" />
                        </asp:BoundField>
                        <asp:TemplateField HeaderText="Criteria" SortExpression="Criteria">
                            <ItemTemplate>
                                <asp:Label ID="Label1" runat="server" Text='<%# Bind("Criteria") %>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Criteria") %>' Rows="3"
                                    TextMode="MultiLine"></asp:TextBox>
                            </EditItemTemplate>
                            <HeaderStyle CssClass="gridViewHead" />
                            <ItemStyle Width="200px" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Remark" SortExpression="Remark">
                            <ItemTemplate>
                                <asp:Label ID="Label2" runat="server" Text='<%# Bind("Remark") %>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Remark") %>' TextMode="MultiLine"
                                    Rows="3"></asp:TextBox>
                            </EditItemTemplate>
                            <HeaderStyle CssClass="gridViewHead" />
                            <ItemStyle Width="200px" />
                        </asp:TemplateField>
                        <asp:CommandField HeaderStyle-CssClass="gridViewHead" ShowEditButton="True">
                            <HeaderStyle CssClass="gridViewHead"></HeaderStyle>
                        </asp:CommandField>
                        <asp:CommandField HeaderStyle-CssClass="gridViewHead" ShowDeleteButton="True">
                            <HeaderStyle CssClass="gridViewHead"></HeaderStyle>
                        </asp:CommandField>
                    </Columns>
                    <AlternatingRowStyle CssClass="gridViewItem2"></AlternatingRowStyle>
                </asp:GridView>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString1 %>"
                    SelectCommand="SELECT * FROM [ScoreEntry]" ConflictDetection="CompareAllValues"
                    DeleteCommand="DELETE FROM [ScoreEntry] WHERE [Id] = @original_Id"
                    OldValuesParameterFormatString="original_{0}" 
                    UpdateCommand="UPDATE [ScoreEntry] SET [Name] = @Name, [MaxScore] = @MaxScore, [Criteria] = @Criteria, [Remark] = @Remark WHERE [Id] = @original_Id ">
                    <DeleteParameters>
                        <asp:Parameter Name="original_Id" Type="Int32" />
                    </DeleteParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="Name" Type="String" />
                        <asp:Parameter Name="MaxScore" Type="Int32" />
                        <asp:Parameter Name="Criteria" Type="String" />
                        <asp:Parameter Name="Remark" Type="String" />
                        <asp:Parameter Name="original_Id" Type="Int32" />
                    </UpdateParameters>
                </asp:SqlDataSource>
            </div>
        </div>
    </div>
</asp:Content>
